using System;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.Security;
using System.Collections.Generic;

namespace SimplePMT
{
	public partial class Master : System.Web.UI.MasterPage
	{

        protected HttpContext htc = HttpContext.Current;

        protected string page
        {
            get
            {
                return htc.Request.Path.Replace(".aspx", "");
            }
        }
        private string _tabSelected = string.Empty;
        public string TabSelected
        {
            get { return _tabSelected; }
            set
            {
                _tabSelected = value;
            }
        }

        public string LogonUser
        { 
            get {
                if (htc.Session["FullName"] == null)
                {
                    FormsAuthentication.SignOut();
                    Session.Abandon();
                    return "";
                }
                else
                {
                    return "User: " + Session["FullName"].ToString();
                }
            }
        }

        public string Selected(string tabname, string resource)
        {
            string result = " class=\"Tab\" OnMouseOver=\"this.className='Tab-Over'\" OnMouseOut=\"this.className='Tab'\"";
            if (resource.ToLower().EndsWith(tabname.ToLower()))
                return " class='Tab-Selected'";
            return result;
        }

        private string _pageTitle = string.Empty;
        public string PageTitle
        {
            get { return _pageTitle; }
            set
            {
                _pageTitle = value;
            }
        }

        private bool _showTabs = true;
        public bool ShowTabs
        {
            get { return _showTabs; }
            set
            {
                _showTabs = value;
            }
        }

        /// <summary>
        /// If the current page in the request matches the pagename passed to the method, it
        /// returns a class style that will indicate a selected tab, otherwise this returns nothing.
        /// </summary>
        /// <param name="pagename">The pagename to test.</param>
        /// <returns></returns>
        
	}
}
